import {} from 'react';
import styles from './index.module.less';
// import { INumItemProps } from '@/types/common';

interface INumItemProps {
    item: {
        title: string;
        bgColor: string;
        filed: string;
    },
    data: any;
}

export default function NumItem (props: INumItemProps) {
    const { item, data } = props;
    return(
        <div className={styles['num-item']} style={{backgroundColor: `${item.bgColor}`}}>
            <span>{item.title}</span>
            <p>{data[item.filed] || 0 }</p>
        </div>
    );
}